home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / QuickDraw GX / QuickDraw GX Info / QuickDraw GX Interfaces / Interfaces & Libraries / Pascal Interfaces & Libraries / Pascal Interfaces / PrintingDrivers.p < prev    next >
Encoding:
Text File  |  1994-03-24  |  28.2 KB  |  780 lines  |  [TEXT/MPS ]

  1. {
  2.     FILENAME
  3.         PrintingDrivers.p
  4.  
  5.     DESCRIPTION
  6.         This file defines data types and API functions for
  7.         printer driver development.
  8.  
  9.     COPYRIGHT
  10.         Copyright © Apple Computer, Inc. 1989, 1990, 1991, 1992, 1993
  11.         All rights reserved. 
  12.     
  13. }
  14. {$IFC UNDEFINED UsingIncludes}
  15. {$SETC UsingIncludes := 0}
  16. {$ENDC}
  17.  
  18. {$IFC NOT UsingIncludes}
  19.     UNIT PrintingDrivers;
  20.     INTERFACE
  21. {$ENDC}
  22.  
  23. {$IFC UNDEFINED UsingPrintingDrivers}
  24. {$SETC UsingPrintingDrivers := 1}
  25.  
  26. {$I+}
  27. {$SETC PrintingDriversIncludes := UsingIncludes}
  28. {$SETC UsingIncludes := 1}
  29. {$IFC UNDEFINED UsingTypes}
  30. {$I $$Shell(PInterfaces)Types.p}
  31. {$ENDC}
  32. {$SETC UsingIncludes := PrintingDriversIncludes}
  33.  
  34. { Constants }
  35.  
  36.  
  37. CONST
  38.     gxInputTraysMenuItem = -1;            { Menu item number for "Input Trays..." }
  39.     gxUseCustomIO    = $00000001;        { driver uses a non-standard IO mechanism }
  40.  
  41.     
  42.     { ----------------------------------• 'prod' •---------------------------------- }
  43.     
  44.     { for PostScript devices, the device and version names of the device.
  45.        (0) product name is of type PString
  46.        (1) version is of type PString
  47.        (2) revision is of type PString
  48.        (3) vm available is of type long }
  49.     
  50.     gxPostscriptProductInfoType    'prod'
  51.     gxPostscriptProductNameID                0;
  52.     gxPostscriptVersionID                    1;
  53.     gxPostscriptRevisionID                    2;
  54.     gxPostscriptVMAvailableID                3;
  55.  
  56.     gxAutoFeedButtonId    = 3;
  57.  
  58.     gxUnivAlertStatusResourceId        = -28508;
  59.     gxUnivManualFeedIndex             = 2;
  60.     gxUnivFailToPrintIndex             = 3;
  61.     gxUnivPaperJamIndex             = 4;
  62.     gxUnivOutOfPaperIndex             = 5;
  63.     gxUnivNoPaperTrayIndex             = 6;
  64.     gxUnivPrinterReadyIndex         = 7;
  65.     gxUnivAlertBeforeIndex             = 9;
  66.     gxUnivAlertAfterIndex             = 10;
  67.  
  68.     { allocation sizes for status buffers needed for automatic alerts }
  69.     gxDefaultStatusBufferSize        = 10;
  70.     gxManualFeedStatusBufferSize     = 34;
  71.     gxOutOfPaperStatusBufferSize     = 42;
  72.  
  73.     { constants for the "universal" print record...    }
  74.     gxPrintRecordVersion        = 8;
  75.     gxAutoFeed                    = 0;
  76.     gxManualFeed                = 1;
  77.     gxPreciseBitmap                = $0001;
  78.     gxBiggerPages                = $0002;
  79.     gxGraphicSmoothing            = $0004;
  80.     gxTextSmoothing                = $0008;
  81.     gxFontSubstitution            = $0010;
  82.     gxInvertPage                = $0020;
  83.     gxFlipPageHoriz                = $0040;
  84.     gxFlipPageVert                = $0080;
  85.     gxColorMode                    = $0100;
  86.     gxBidirectional                = $0200;
  87.     gxUserFlag0                    = $0400;
  88.     gxUserFlag1                    = $0800;
  89.     gxUserFlag2                    = $1000;
  90.     gxReservedFlag0                = $2000;
  91.     gxReservedFlag1                = $4000;
  92.     gxReservedFlag2                = $8000;
  93.     gxPortraitOrientation        = 0;
  94.     gxLandscapeOrientation        = 1;
  95.     gxAltPortraitOrientation    = 2;
  96.     gxAltLandscapeOrientation    = 3;
  97.     gxBestQuality                = 0;
  98.     gxFasterQuality                = 1;
  99.     gxDraftQuality                = 2;
  100.     gxFirstTray                    = 0;
  101.     gxSecondTray                = 1;
  102.     gxThirdTray                    = 2;
  103.     gxNoCoverPage                = 0;
  104.     gxFirstPageCover            = 1;
  105.     gxLastPageCover                = 2;
  106.     gxUnidirectionalMotion        = 0;
  107.     gxBidirectionalMotion        = 1;
  108.     gxNoFile                    = 0;
  109.     gxPostScriptFile            = 1;
  110.  
  111.     { Raster Driver Contants }
  112.     gxDefaultOffscreen             = $00000000;    { default value - bits are allocated for the client, halftoning takes place }
  113.     gxDontSetHalftone            = $00000001;    { don't call SetViewPortHalftone }
  114.     gxDotTypeIsDitherLevel        = $00000002;    { call SetViewPortDither using the dotType as the level }
  115.     gxDefaultRaster                = $00000000;    { default raster options }
  116.     gxDontResolveTransferModes     = $00000001;    { 0=Resolve, 1=Don't Resolve }
  117.     gxRenderInReverse             = $00000002;    { traverse image in reverse order }
  118.     gxOnePlaneAtATime            = $00000004;    { render each plane separately }
  119.     gxSendAllBands                = $00000008;    { send even empty bands }
  120.  
  121.     gxSendAllColors                = $00000001;                            { send even clean bands through }
  122.     gxInterlaceColor            = $00000002;                            { ribbon contamination is a concern }
  123.     gxOverlayColor                = $00000004;                            { color printer without a ribbon problem }
  124.     gxUseColor                    = gxInterlaceColor+gxOverlayColor;        { this is a color printer }
  125.  
  126.     { Vector Driver Contants }
  127.     gxColorSort                    = $00000001;    { set for pen plotters.  }
  128.     gxATransferMode                = $00000002;    { set if transfer modes need to be resolved  }
  129.     gxNoOverlap                    = $00000004;    { set if non-overlapping output is desired }
  130.     gxAColorBitmap                = $00000008;    { set if color bitmap output is desired }
  131.     gxSortbyPenPos                = $00000010;    { set if shapes are to be drawn in the order of the pen index }
  132.                                                  { in the pen table. NOTE: this is not the pen position in the carousel. }
  133.     gxPenLessPlotter            = $00000020;    { indicates raster printer/plotter }
  134.     gxCutterPlotter                = $00000040;    { indicates cutter }
  135.     gxNoBackGround                = $00000080;    { set if shapes that map to the background color should not be sent to driver  }
  136.     gxUnidirectionalFill        = $00000001;    { generate scanlines in one direction only.. useful for transparencies }
  137.     gxAlsoOutlineFilledShape    = $00000002;    { turn on this bit to also outline solid filled shapes  }
  138.  
  139.     { PostScript Driver Contants }
  140.     gxPostSynonym                 = 'post';
  141.     
  142.     gxNeedsHexOption            = $00000001;    { convert all binary data to hex }
  143.     gxNeedsCommentsOption        = $00000002;    { issue PostScript comments }
  144.     gxBoundingBoxesOption        = $00000004;    { calculate the values for %%BoundingBox: and %%PageBoundingBox: -- requires needsCommentsOption }
  145.     gxPortablePostScriptOption    = $00000008;    { generate portable PostScript }
  146.     gxTextClipsToPathOption        = $00000010;    { convert all clips that are composed of text to path shapes }
  147.     gxFlattenClipPathOption        = $00000020;    { convert all clips that are path shapes to polygons (helps better control point limit) }
  148.     gxUseCharpath1Option        = $00000040;    { (ignored if text clips are converted to paths)  When the clip is text,  }
  149.                                                     { do it one glyph at a time, redrawing the main shape each time }
  150.     gxUseLevel2ColorOption        = $00000080;    { When printing to level-2 use level-2 device independent color }
  151.  
  152.     gxPrinterOK                = 0;
  153.     gxIntializePrinter        = 1; 
  154.     gxFilePrinting            = 2;
  155.     gxResetPrinter             = 128;
  156.  
  157.     gxMissingImagePointer = -4;            { for printer gxViewDevice bitmaps }
  158.     
  159. TYPE
  160.  
  161. {Printing Driver Types}
  162.  
  163. gxIOPrefsRec  = PACKED RECORD
  164.     communicationsOptions: LongInt;
  165.     numBuffers: LongInt;
  166.     bufferSize: LongInt;
  167.     numReqBlocks: LongInt;
  168.     openCloseTimeout: LongInt;
  169.     readWriteTimeout: LongInt;
  170.     END;
  171. gxIOPrefsPtr = ^gxIOPrefsRec;
  172. gxIOPrefsHdl = ^gxIOPrefsPtr;
  173.  
  174. gxPrintDestinationRec  = PACKED RECORD
  175.     printToFile: Boolean;        { true if output is to go to a file }
  176.     fSpec: FSSpec;                { if going to a file, the FSSpec for the file }
  177.     includeFonts: Byte;            { true if fonts are to be included }
  178.     fileFormat: Str31;            { format to write file }
  179.     END;
  180. gxPrintDestinationPtr = ^gxPrintDestinationRec;
  181. gxPrintDestinationHdl = ^gxPrintDestinationPtr;
  182.  
  183.  
  184. gxPortListRec  = PACKED RECORD
  185.     firstMarker: Byte;
  186.     secondMarker: Byte;            { markers to indicate icon or non-icon version }
  187.                                                 { if these are ≈ and ≈, then the cell is an icon cell. }
  188.                                                 { Otherwise, it is assumed to be a standard text LDEF }
  189.                                                 { cell }
  190.     
  191.     iconSuiteHandle: Handle;    { the icon suite to draw for this cell }
  192.     outputDriverName: Handle;    { handle to the output driver name (for serial) }
  193.     inputDriverName: Handle;    { handle to the input driver name (for serial) }
  194.     iconName: Str255;            { name to draw under the icon }
  195.     END;
  196. gxPortListPtr = ^gxPortListRec;
  197.  
  198. gxManualFeedRecord  = PACKED RECORD
  199.     canAutoFeed: Boolean;        { true if driver can switch to auto feed }
  200.     paperTypeName: Str31;        { name of paperType to feed manually }
  201.     END;
  202.     
  203. gxOutOfPaperRecord  = PACKED RECORD
  204.     paperTypeName: Str31;        
  205.     END;
  206.     
  207. {Old Application Support}
  208.  
  209. gxCustomizationRec  = PACKED RECORD
  210.     horizontalResolution: INTEGER;
  211.     verticalResolution: INTEGER;
  212.     upDriverType: INTEGER;
  213.     patternStretch: Point;
  214.     translatorSettings: INTEGER;
  215.     END;
  216. gxCustomizationPtr = ^gxCustomizationRec;
  217. gxCustomizationHdl = ^gxCustomizationPtr;
  218.  
  219. gxResolutionRec  = PACKED RECORD
  220.     rangeType: INTEGER;                
  221.     xMinimumResolution: INTEGER;
  222.     xMaximumResolution: INTEGER;
  223.     yMinimumResolution: INTEGER;
  224.     yMaximumResolution: INTEGER;
  225.     resolutionCount;
  226.     resolutions: ARRAY [0..0] OF Point;
  227.     END;
  228. gxResolutionPtr = ^gxResolutionRec;
  229. gxResolutionHdl = ^gxResolutionPtr;
  230.  
  231. gxUniversalPrintRecord  = PACKED RECORD
  232.     prVersion: INTEGER;          { print record version  }
  233.     
  234.                                 { prInfo subrecord... }
  235.     
  236.     appDev: INTEGER;            { device kind, always 0 }
  237.     appVRes: INTEGER;            { application vertical resolution }
  238.     appHRes: INTEGER;            { application horizontal resolution }
  239.     appPage: Rect;                { page size, in application resolution }
  240.     
  241.     appPaper: Rect;                { paper rectangle [offset from rPage] }
  242.     
  243.                                 { prStl subrecord... }
  244.                                         
  245.     devType: INTEGER;            { device type, always 0xA900 (was wDev) }
  246.     pageV: INTEGER;                { page height in 120ths of an inch }
  247.     pageH: INTEGER;                { page width in 120ths of an inch }
  248.     fillByte: Byte;                { page calculation mode }
  249.     feed: Byte;                    { feed mode }
  250.     
  251.                                 { prInfoPT subrecord... }
  252.                                         
  253.     devKind: INTEGER;            { device kind, always 0 }
  254.     devVRes: INTEGER;            { device vertical resolution }
  255.     devHRes: INTEGER;            { device horizontal resolution }
  256.     devPage: Rect;                { device page size }
  257.     
  258.                                 { prXInfo subrecord... }
  259.                                         
  260.     actualCopies: INTEGER;        { actual number of copies for this job }
  261.     options: INTEGER;            { options for this device }
  262.     reduction: INTEGER;            { reduce/enlarge factor }
  263.     
  264.     orientation: Byte;            { orientation of paper ( 0=portrait, 1=landscape ) }
  265.     
  266.                                 { clusters... }
  267.                                         
  268.     qualityMode: Byte;            { quality mode }
  269.     coverPage: Byte;            { cover page }
  270.     firstTray: Byte;            { first feed tray }
  271.     remainingTray: Byte;        { remaining feed tray }
  272.     headMotion: Byte;            { head motion }
  273.     saveFile: Byte;                { save file }
  274.     
  275.     userCluster1: Byte;            { three clusters left over... }
  276.     userCluster2: Byte;
  277.     userCluster3: Byte;
  278.  
  279.                                 { prJob subrecord... }
  280.                                     
  281.     firstPage: INTEGER;            { first page }
  282.     lastPage: INTEGER;            { last page }
  283.     copies: INTEGER;            { # of copies, always 1 }
  284.     reserved1: Byte;            { always true, unused }
  285.     reserved2: Byte;            { always true, unused }
  286.     pIdleProc: PrIdleProcPtr;    { idle proc }
  287.     pFileName: Ptr;                { spool file name pointer }
  288.     fileVol: INTEGER;            { spool file vRefNum }
  289.     fileVers: Byte;                { file version, must be 0 }
  290.     reserved3: Byte;            { always 0 }
  291.     
  292.     printX[19]: ARRAY [0..18] OF INTEGER;          { internal use }
  293.     END;
  294. gxUniversalPrintRecordPtr = ^gxUniversalPrintRecord;
  295. gxUniversalPrintRecordHdl = ^gxUniversalPrintRecordPtr;
  296.  
  297. {Raster Driver Types}
  298.  
  299. gxPlaneSetupRec  = PACKED RECORD
  300.     planeOptions: gxRasterPlaneOptions;    { options for the offscreen package }
  301.     planeHalftone: gxHalftone;            { OPTIONAL: halftone structure for this plane }
  302.     planeSpace: gxColorSpace;            { OPTIONAL: noSpace will get the graphics default }
  303.     planeSet: gxColorSet;                { OPTIONAL: NIL gets the default }
  304.     planeProfile: gxColorProfile;        { OPTIONAL: NIL gets no matching }
  305.     END;
  306.  
  307. gxOffscreenSetupRec  = PACKED RECORD
  308.     width: INTEGER;                 { Width in pixels }
  309.     minHeight: INTEGER;             { minimum height in pixels - actual height returned here }
  310.     maxHeight: INTEGER;                { maximum height in pixels }
  311.     ramPercentage: Fixed;            { maximum percentage of RAM to take }
  312.     ramSlop: LongInt;                { amount of RAM to be sure to leave }
  313.     depth: INTEGER;                 { Depths in bits of each plane }
  314.     vpMapping: gxMapping;            { mapping to assign to offscreen viewPorts }
  315.     vdMapping: gxMapping;            { mapping to assign to offscreen viewDevices }
  316.     planes: INTEGER;                { # of planes to allocate of depth bits each (can be more than 4) }
  317.     planeSetup: ARRAY [0..3] OF gxPlaneSetupRec;        { parameters for each plane, 4 is provided because it is most handy for writers of devices }
  318.     END;
  319.  
  320.  
  321. gxOffscreenPlaneRec  = PACKED RECORD
  322.     theViewPort: gxViewPort;        { viewPort for the offscreen }
  323.     theDevice: gxViewDevice;        { viewDevice for the offscreen }
  324.     theViewGroup: gxViewGroup;        { the viewGroup that they share }
  325.     theBitmap: gxShape;                { the offscreen bitmap shape }
  326.     theBits: gxBitmap;                { the bits of the offscreen }
  327.     END;
  328.  
  329. gxOffscreenRec  = PACKED RECORD
  330.     numberOfPlanes: INTEGER;        { number of planes we have }
  331.     offscreenStorage: Handle;        { handle containing the bitmaps image data }
  332.     thePlanes: ARRAY [0..0] OF gxOffscreenPlaneRec;        { planes to draw in }
  333.     END;
  334. gxOffscreenPtr = ^gxOffscreenRec;
  335. gxOffscreenHdl = ^gxOffscreenPtr;
  336.  
  337. gxRasterRenderOptions = LongInt;
  338. gxRasterPackageOptions = LongInt;
  339.  
  340. gxRasterPrefsRec  = PACKED RECORD
  341.     renderOptions: gxRasterRenderOptions;    { options for the raster imaging system }
  342.     hImageRes: Fixed;            { horizontal resolution to image at }
  343.     vImageRes: Fixed;            { vertical resolution to image at }
  344.     minBandSize: INTEGER;        { minimum band size to use (in pixels) }
  345.     maxBandSize: INTEGER;        { maximum band size to use (in pixels), 0 == entire page }
  346.     ramPercentage: Fixed;        { maximum percentage of RAM to take }
  347.     ramSlop: LongInt;            { amount of RAM to be sure to leave }
  348.     depth: INTEGER;                { depth in pixels (PER PLANE!) }
  349.     numPlanes: INTEGER;            { number of planes to render }
  350.     planeSetup: ARRAY [0..0] OF gxPlaneSetupRec;    { one for each plane }
  351.     END;
  352. gxRasterPrefsPtr = ^gxRasterPrefsRec;
  353. gxRasterPrefsHdl = ^gxRasterPrefsPtr;
  354.  
  355. gxRasterPackageRec  = PACKED RECORD
  356.     bufferSize: Ptr;                            { buffer size for packaging (>= maximum head pass size) }
  357.     colorPasses: INTEGER;                        { 1 (b/w) or 4 (CMYK) is typical }
  358.     headHeight: INTEGER;                        { printhead height in pixels }
  359.     numberPasses: INTEGER;                        { number of head passes it takes to == iHeadHeight }
  360.     passOffset: INTEGER;                        { offset between passes, in pixels }
  361.     packageOptions: gxRasterPackageOptions;        { packaging options }
  362.     END;
  363. gxRasterPackagePtr = ^gxRasterPackageRec;
  364. gxRasterPackageHdl = ^gxRasterPackagePtr;
  365.  
  366. gxBitmapPtr = ^gxBitmap;
  367. gxRasterPackageBitmapRec  = PACKED RECORD
  368.     bitmapToPackage: gxBitmapPtr;    { bitmap containing the data to package }
  369.     startRaster: INTEGER;            { raster to begin the packaging from }
  370.     colorBand: INTEGER;                { for which color pass this is a packaging request }
  371.     isBandDirty: Boolean;            { whether there are any dirty bits in this band }
  372.     dirtyRect: Rect;                { which bits are dirty }
  373.     END;
  374.  
  375. gxStandardNumberRec  = PACKED RECORD
  376.     numberType: INTEGER;            { type of numberic output desired }
  377.     minWidth: INTEGER;                { minimum output width of the number }
  378.     padChar: Byte;                    { pad character for numbers shorter than the minWidth }
  379.     alignment: Byte;                { whee! }
  380.     startString: Str31;                { prefix string }
  381.     endString: Str31;                { postfix string }
  382.     END;
  383. gxStandardNumberRec = ^gxStandardNumberPtr;
  384.  
  385. gxRasterPackageControlsRec  = PACKED RECORD
  386.     startPageStringID: INTEGER;            { 'wstr' to send to the device at start of page }
  387.     formFeedStringID: INTEGER;            { 'wstr' to send to the device to cause a form feed }
  388.     forwardMax: INTEGER;                { line feed strings }
  389.     forwardLineFeed: gxStandardNumberRec;
  390.     reverseMax: INTEGER;
  391.     reverseLineFeed: gxStandardNumberRec;
  392.     END;
  393. gxRasterPackageControlsPtr = ^gxRasterPackageControlsRec;
  394. gxRasterPackageControlsHdl = ^gxRasterPackageControlsPtr;
  395.  
  396. gxRasterImageDataRec  = PACKED RECORD
  397.     { setup values }
  398.  
  399.     renderOptions: gxRasterRenderOptions;        { options for the raster imaging system }
  400.     hImageRes: Fixed;                            { horizontal resolution to image at }
  401.     vImageRes: Fixed;                            { vertical resolution to image at }
  402.     minBandSize: INTEGER;                        { smallest band that makes sense for this device }
  403.     maxBandSize: INTEGER;                        { biggest band that makes sense, or 0 for "full page" }
  404.     pageSize: gxRectangle;                        { size of page for device }
  405.     
  406.     { values used within the RasterDataIn message }
  407.     
  408.     currentYPos: INTEGER;                        { current position moving down the page }
  409.     packagingInfo: gxRasterPackageRec;            { raster packaging record }
  410.     
  411.     { values used within the remaining messages }
  412.     
  413.     optionsValid: Boolean;                            { were options specified by the driver? }
  414.     packageControls: gxRasterPackageControlsRec;    { options for the packaging messages }
  415.  
  416.     theSetup: gxOffscreenSetupRec;                    { setup for the offscreen code, variable length componant }
  417.     END;
  418. gxRasterImageDataPtr = ^gxRasterImageDataRec;
  419. gxRasterImageDataHdl = ^gxRasterImageDataPtr;
  420.  
  421.  
  422. { Vector Driver Types }
  423.  
  424. gxVectorRenderOptions = LongInt;
  425. gxVectorShapeOptions = LongInt;
  426.  
  427. gxVHalftoneCompRec  = PACKED RECORD
  428.     angle: Fixed;                { angle to halftone at. Must be 0, 90, 45 or 135 }
  429.     penIndex: LongInt;            { index of the pen to draw this component with }
  430.     END;
  431.  
  432. gxVHalftoneRec  = PACKED RECORD
  433.     halftoneSpace: gxColorSpace;
  434.     halftoneComps: ARRAY [0..3] OF gxVHalftoneCompRec;    { info for each color component }
  435.     penIndexForBW: LongInt;                              { pen index to draw one bit deep or black and white bitmap with }
  436.     END;
  437.  
  438. gxVectorShapeDataRec  = PACKED RECORD
  439.     shapeOptions: gxVectorShapeOptions;      { options to control shape handling }
  440.     maxPolyPoints: LongInt;                 { maximum number of polygon points that device can support }
  441.     shapeError: Fixed;                        { defines allowed deviation from the original shape }
  442.     textSize: Fixed;                           { text above this size is filled; text below this size is outlined  }
  443.     frameSize: Fixed;                        { frame's smaller than this -> shape stroked; frame's larger -> shape is filled }
  444.     END;
  445.  
  446. gxVectorImageDataRec  = PACKED RECORD
  447.     renderOptions: gxVectorRenderOptions;    { options to control rendering: color sort, clipping, etc. }
  448.     devRes: Fixed;                            { device resolution }
  449.     devTransform: gxTransform;                { mapping, clip and halftoning information for colored bitmaps }
  450.     clrSet: gxColorSet;                        { entire set of colors; usually indexed color space for pen plotters }
  451.     bgColor: gxColor;                        { the background color in the color space specified by the clrSpace field }
  452.     halftoneInfo: gxVHalftoneRec;            { defines halftone information for color bitmaps }
  453.     hPenTable: gxPenTableHdl;                { complete list of pens along with their pen positions and thickness }
  454.     pageRect: gxRectangle;                    { page dimensions }
  455.     shapeData: gxVectorShapeDataRec;        { information on how to render a shape }
  456.     END;
  457. gxVectorImageDataPtr = ^gxVectorImageDataRec;
  458. gxVectorImageDataHdl = ^gxVectorImageDataPtr;
  459.  
  460.  
  461. { PostScript Driver Types }
  462.  
  463. gxVectorImageDataRec  = PACKED RECORD
  464.     theFont: gxFont;                        { ---> font reference. }
  465.     nGlyphs: LongInt;                        { ---> Number of glyphs in the font. }
  466.  
  467.     platform: gxFontPlatform;                { <--- How printer font is encoded. }
  468.     script: gxFontScript;                    { <--- Script if platform != glyphPlatform }
  469.     language: gxFontLanguage;                { <--- Language if platform != glyphPlatform. }
  470.     
  471.     vmUsage: LongInt;                        { <--- how much PostScript VM font uses. }
  472.  
  473.     { size of this is longAlligned(nGlyphs) }
  474.     glyphBits: ARRAY [0..0] OF LongInt;        { <--- Bit array of which system glyphs are in printer. }
  475.     END;
  476.  
  477. gxPostScriptImageDataRec  = PACKED RECORD
  478.     languageLevel: INTEGER;                        { PostScript language level }
  479.     devCSpace: gxColorSpace;                    { the printer's color space }
  480.     devCProfile: gxColorProfile;                { The printer's color profile for matching }
  481.     renderOptions: gxPostScriptRenderOptions;    { options for the imaging system }
  482.     pathLimit: LongInt;                            { maximum path size }
  483.     gsaveLimit: INTEGER;                        { maximum number of gsaves allowed }
  484.     opStackLimit: INTEGER;                        { operand stack limit }
  485.     fontType: scalerStreamTypeFlag;                { these are the font types that the printer supports  }
  486.     printerVM: LongInt;                            { how much memory is in the printer }
  487.     reserved0: LongInt;
  488.     END;
  489. gxPostScriptImageDataPtr = ^gxPostScriptImageDataRec;
  490. gxPostScriptImageDataHdl = ^gxPostScriptImageDataPtr;
  491.  
  492. gxProcSetListRec  = PACKED RECORD
  493.     clientid: Signature;
  494.     controlType: OSType;                        { the driver will call FetchTaggedData on each of these resources }
  495.     controlid: INTEGER;
  496.     dataType: OSType;
  497.     reserved0: LongInt;
  498.     END;
  499. gxProcSetListPtr = ^gxProcSetListRec;
  500. gxProcSetListHdl = ^gxProcSetListPtr;
  501.  
  502. {********************************************************************}
  503. {************************ Compatibility Messages ********************}
  504. {********************************************************************}
  505. FUNCTION Forward_GXPrOpenDoc (printRecord: THPrint; VAR port: TPPrPort): OSErr;
  506.     C;
  507.  
  508. FUNCTION Forward_GXPrCloseDoc (port: TPPrPort): OSErr;
  509.     C;
  510.  
  511. FUNCTION Forward_GXPrOpenPage (port: TPPrPort; pageRect: TPRect: resolution: Point): OSErr;
  512.     C;
  513.  
  514. FUNCTION Forward_GXPrClosePage (port: TPPrPort): OSErr;
  515.     C;
  516.  
  517. FUNCTION Forward_GXPrintDefault (printRecord: THPrint): OSErr;
  518.     C;
  519.  
  520. FUNCTION Forward_GXPrStlDialog (printRecord: THPrint; VAR didConfirm: Boolean): OSErr;
  521.     C;
  522.  
  523. FUNCTION Forward_GXPrJobDialog (printRecord: THPrint; VAR didConfirm: Boolean): OSErr;
  524.     C;
  525.  
  526. FUNCTION Forward_GXPrStlInit (printRecord: THPrint; VAR dialogSetup: TPPrDlg): OSErr;
  527.     C;
  528.  
  529. FUNCTION Forward_GXPrJobInit (printRecord: THPrint; VAR dialogSetup: TPPrDlg): OSErr;
  530.     C;
  531.  
  532. FUNCTION Forward_GXPrDlgMain (printRecord: THPrint; theProc: PDlgInitProcPtr; VAR didConfirm: Boolean): OSErr;
  533.     C;
  534.  
  535. FUNCTION Forward_GXPrValidate (printRecord: THPrint; VAR didValidate: Boolean): OSErr;
  536.     C;
  537.  
  538. FUNCTION Forward_GXPrJobMerge (printRecord: THPrint; printRecord: THPrint): OSErr;
  539.     C;
  540.  
  541. FUNCTION Forward_GXPrGeneral (aPtr: Ptr): OSErr;
  542.     C;
  543.  
  544. FUNCTION Forward_GXConvertPrintRecordTo (printRecord: THPrint): OSErr;
  545.     C;
  546.  
  547. FUNCTION Forward_GXConvertPrintRecordFrom (printRecord: THPrint): OSErr;
  548.     C;
  549.  
  550. FUNCTION Forward_GXPrintRecordToJob (printRecord: THPrint; theJob: gxJob): OSErr;
  551.     C;
  552.  
  553.  
  554. {********************************************************************}
  555. {************************ Raster Messages ***************************}
  556. {********************************************************************}
  557.  
  558. FUNCTION Send_GXRasterDataIn (theOffscreen: gxOffscreenHdl; VAR bandRectangle: gxRectangle; VAR dirtyRectangle: gxRectangle): OSErr;
  559.     C;
  560. FUNCTION Forward_GXRasterDataIn (theOffscreen: gxOffscreenHdl; VAR bandRectangle: gxRectangle; VAR dirtyRectangle: gxRectangle): OSErr;
  561.     C;
  562.          
  563. FUNCTION Send_GXRasterLineFeed (VAR lineFeedSize: INTEGER; buffer: Ptr; VAR bufferPos: LongInt; theImageData: gxRasterImageDataHdl): OSErr;
  564.     C;
  565. FUNCTION Forward_GXRasterLineFeed (VAR lineFeedSize: INTEGER; buffer: Ptr; VAR bufferPos: LongInt; theImageData: gxRasterImageDataHdl): OSErr;
  566.     C;
  567.     
  568. FUNCTION Send_GXRasterPackageBitmap (VAR whatToPackage: gxRasterPackageBitmapRec; buffer: Ptr;
  569.                                           VAR bufferPos: LongInt; theImageData: gxRasterImageDataHdl): OSErr;
  570.     C;
  571. FUNCTION Forward_GXRasterPackageBitmap (VAR whatToPackage: gxRasterPackageBitmapRec; buffer: Ptr;
  572.                                           VAR bufferPos: LongInt; theImageData: gxRasterImageDataHdl): OSErr;
  573.     C;
  574.  
  575.  
  576. {********************************************************************}
  577. {************************ Vector Messages ***************************}
  578. {********************************************************************}
  579.  
  580. FUNCTION Send_GXVectorPackageShape (theShape: gxShape; penIndex:LongInt): OSErr;
  581.     C;
  582. FUNCTION Forward_GXVectorPackageShape (theShape: gxShape; penIndex:LongInt): OSErr;
  583.     C;
  584.     
  585. FUNCTION Send_GXVectorLoadPens (thePenTable: gxPenTableHdl; VAR shapeCounts: LongInt; VAR penTableChanged: Boolean): OSErr;
  586.     C;
  587. FUNCTION Forward_GXVectorLoadPens (thePenTable: gxPenTableHdl; VAR shapeCounts: LongInt; VAR penTableChanged: Boolean): OSErr;
  588.     C;
  589.  
  590. FUNCTION Send_GXVectorVectorizeShape (theShape: gxShape; penIndex:LongInt; VAR theData: gxVectorShapeDataRec): OSErr;
  591.     C;
  592. FUNCTION Forward_GXVectorVectorizeShape (theShape: gxShape; penIndex:LongInt; VAR theData: gxVectorShapeDataRec): OSErr;
  593.     C;
  594.  
  595.  
  596.  
  597. {********************************************************************}
  598. {************************ PostScript Messages ***********************}
  599. {********************************************************************}
  600.  
  601.  
  602. { device control messages }
  603.  
  604. FUNCTION Send_GXPostScriptQueryPrinter (VAR result: LongInt): OSErr;
  605.     C;
  606. FUNCTION Forward_GXPostScriptQueryPrinter (VAR): OSErr;
  607.     C;
  608.  
  609. FUNCTION Send_GXPostScriptInitializePrinter : OSErr;
  610.     C;
  611. FUNCTION Forward_GXPostScriptInitializePrinter : OSErr;
  612.     C;
  613.  
  614. FUNCTION Send_GXPostScriptResetPrinter : OSErr;
  615.     C;
  616. FUNCTION Forward_GXPostScriptResetPrinter : OSErr;
  617.     C;
  618.  
  619. FUNCTION Send_GXPostScriptExitServer : OSErr;
  620.     C;
  621. FUNCTION Forward_GXPostScriptExitServer : OSErr;
  622.     C;
  623.     
  624.     
  625. { device communication messages }
  626.  
  627.  
  628. FUNCTION Send_GXPostScriptGetStatusText (statusText: Handle): OSErr;
  629.     C;
  630. FUNCTION Forward_GXPostScriptGetStatusText (statusText: Handle): OSErr;
  631.     C;
  632.  
  633. FUNCTION Send_GXPostScriptGetPrinterText (printerText: Handle): OSErr;
  634.     C;
  635. FUNCTION Forward_GXPostScriptGetPrinterText (printerText: Handle): OSErr;
  636.     C;
  637.  
  638. FUNCTION Send_GXPostScriptScanStatusText (statusText: Handle): OSErr;
  639.     C;
  640. FUNCTION Forward_GXPostScriptScanStatusText (statusText: Handle): OSErr;
  641.     C;
  642.  
  643. FUNCTION Send_GXPostScriptScanPrinterText (printerText: Handle): OSErr;
  644.     C;
  645. FUNCTION Forward_GXPostScriptScanPrinterText (printerText: Handle): OSErr;
  646.     C;
  647.  
  648.  
  649. { proc set management messages }
  650.  
  651.  
  652. FUNCTION Send_GXPostScriptGetDocumentProcSetList (theProcSets: gxProcSetListHdl; theImageData: gxPostScriptImageDataHdl): OSErr;
  653.     C;
  654. FUNCTION Forward_GXPostScriptGetDocumentProcSetList (theProcSets: gxProcSetListHdl; theImageData: gxPostScriptImageDataHdl): OSErr;
  655.     C;
  656.  
  657. FUNCTION Send_GXPostScriptDownloadProcSetList (theProcSets: gxProcSetListHdl; theImageData: gxPostScriptImageDataHdl): OSErr;
  658.     C;
  659. FUNCTION Forward_GXPostScriptDownloadProcSetList (theProcSets: gxProcSetListHdl; theImageData: gxPostScriptImageDataHdl): OSErr;
  660.     C;
  661.     
  662.     
  663. { font management messages }
  664.  
  665.  
  666. FUNCTION Send_GXPostScriptGetPrinterGlyphsInformation (VAR theGlyphs: gxPrinterGlyphsRec): OSErr;
  667.     C;
  668. FUNCTION Forward_GXPostScriptGetPrinterGlyphsInformation (VAR theGlyphs: gxPrinterGlyphsRec): OSErr;
  669.     C;
  670.  
  671. FUNCTION Send_GXPostScriptStreamFont (fontref: gxFont; VAR streamPtr: scalerStream): OSErr;
  672.     C;
  673. FUNCTION Forward_GXPostScriptPostScriptStreamFont (fontref: gxFont; VAR streamPtr: scalerStream): OSErr;
  674.     C;
  675.  
  676.  
  677. { document structuring and formatting messages }
  678.  
  679.  
  680. FUNCTION Send_GXPostScriptDoDocumentHeader (theImageData: gxPostScriptImageDataHdl): OSErr;
  681.     C;
  682. FUNCTION Forward_GXPostScriptDoDocumentHeader (theImageData: gxPostScriptImageDataHdl): OSErr;
  683.     C;
  684.     
  685. FUNCTION Send_GXPostScriptDoDocumentSetup (theImageData: gxPostScriptImageDataHdl): OSErr;
  686.     C;
  687. FUNCTION Forward_GXPostScriptDoDocumentSetup (theImageData: gxPostScriptImageDataHdl): OSErr;
  688.     C;
  689.  
  690. FUNCTION Send_GXPostScriptDoDocumentTrailer (theImageData: gxPostScriptImageDataHdl): OSErr;
  691.     C;
  692. FUNCTION Forward_GXPostScriptDoDocumentTrailer (theImageData: gxPostScriptImageDataHdl): OSErr;
  693.     C;
  694.     
  695.     
  696. { page structuring and formatting messages }
  697.  
  698.  
  699. FUNCTION Send_GXPostScriptDoPageSetup (theFormat: gxFormat; which: LongInt; theImageData: gxPostScriptImageDataHdl): OSErr;
  700.     C;
  701. FUNCTION Forward_GXPostScriptDoPageSetup (theFormat: gxFormat; which: LongInt; theImageData: gxPostScriptImageDataHdl): OSErr;
  702.     C;
  703.  
  704. FUNCTION Send_GXPostScriptSelectPaperType (thePaperType: gxPaperType; which: LongInt; theImageData: gxPostScriptImageDataHdl): OSErr;
  705.     C;
  706. FUNCTION Forward_GXPostScriptSelectPaperType (thePaperType: gxPaperType; which: LongInt; theImageData: gxPostScriptImageDataHdl): OSErr;
  707.     C;
  708.  
  709. FUNCTION Send_GXPostScriptDoPageTrailer (theImageData: gxPostScriptImageDataHdl): OSErr;
  710.     C;
  711. FUNCTION Forward_GXPostScriptDoPageTrailer (theImageData: gxPostScriptImageDataHdl): OSErr;
  712.     C;
  713.  
  714. FUNCTION Send_GXPostScriptEjectPage (thePaperType: gxPaperType; pagenumber: LongInt; copiescount: LongInt; erasepage: INTEGER; theImageData: gxPostScriptImageDataHdl): OSErr;
  715.     C;
  716. FUNCTION Forward_GXPostScriptEjectPage (thePaperType: gxPaperType; pagenumber: LongInt; copiescount: LongInt; erasepage: INTEGER; theImageData: gxPostScriptImageDataHdl): OSErr;
  717.     C;
  718.  
  719.  
  720. { shape imaging messages }
  721.  
  722. gxTranformPtr = ^gxTransform;
  723. FUNCTION Send_GXPostScriptProcessShape (page: gxShape; trcount: LongInt; trlist: gxTranformPtr): OSErr;
  724.     C;
  725. FUNCTION Forward_GXPostScriptProcessShape (page: gxShape; trcount: LongInt; trlist: gxTranformPtr): OSErr;
  726.     C;
  727.  
  728.  
  729.  
  730. {********************************************************************}
  731. {************************ Driver Interfaces *************************}
  732. {********************************************************************}
  733.  
  734. FUNCTION GXAddPrinterViewDevice (thePrinter: gxPrinter; theViewDevice: gxViewDevice): OSErr;
  735.     C;
  736.  
  737. FUNCTION GXGetAvailableJobFormatModes (VAR theTable: gxJobFormatModeTableHdl): OSErr;
  738.     C;
  739.  
  740. FUNCTION GXSetPreferredJobFormatMode (theMode: gxJobFormatMode; directOnly: Boolean): OSErr;
  741.     C;
  742.  
  743. FUNCTION GXPrintingAlert(
  744.                     iconID: INTEGER;
  745.                     txtSize: INTEGER;
  746.                     defaultTitleNum: INTEGER;
  747.                     cancelTitleNum: INTEGER;
  748.                     textLen: INTEGER;
  749.                     pAlertMsg: Ptr;
  750.                     actionTitle: StringPtr;
  751.                     title2: StringPtr;
  752.                     title3: StringPtr;
  753.                     msgFont: StringPtr;
  754.                     filterProc: ModalFilterProcPtr;
  755.                     VAR itemHit:  INTEGER;
  756.                     alertTitle: StringPtr): OSErr;
  757.     C; 
  758.     
  759. FUNCTION GXGetPrintingAlert(
  760.                     alertResId: INTEGER;
  761.                     filterProc: ModalFilterProcPtr;
  762.                     VAR itemHit:  INTEGER): OSErr;
  763.     C; 
  764.  
  765. FUNCTION GXFetchDTPData (dtpName: Str31; theType: OSType; theID:INTEGER; VAR theData: Handle): OSErr;
  766.     C;
  767.  
  768. FUNCTION GXWriteDTPData (dtpName: Str31; theType: OSType; theID:INTEGER; theData: Handle): OSErr;
  769.     C;
  770.  
  771. FUNCTION GXHandleChooserMessage (VAR aJob: gxJob; driverName:Str31; message: INTEGER; caller: INTEGER; 
  772.                                      objName: StringPtr; zoneName: StringPtr; theList: ListHandle; p2: LongInt): OSErr;
  773.     C;
  774.  
  775. {$ENDC}    { UsingPrintingDrivers }
  776.  
  777. {$IFC NOT UsingIncludes}
  778.     END.
  779. {$ENDC}
  780.